<?php
if (! defined('PHPMYADMIN')) { exit; } if (PMA_MYSQL_INT_VERSION >= 50002) { $url_query .= '&amp;goto=db_structure.php'; $routines = PMA_DBI_fetch_result('SELECT SPECIFIC_NAME,ROUTINE_NAME,ROUTINE_TYPE,DTD_IDENTIFIER FROM information_schema.ROUTINES WHERE ROUTINE_SCHEMA= \'' . PMA_sqlAddslashes($db,true) . '\';'); if ($routines) { echo '<fieldset>' . "\n"; echo ' <legend>' . $strRoutines . '</legend>' . "\n"; echo '<table border="0">'; echo sprintf('<tr>
<th>%s</th>
<th>&nbsp;</th>
<th>&nbsp;</th>
<th>%s</th>
<th>%s</th>
</tr>', $strName, $strType, $strRoutineReturnType); $ct=0; $delimiter = '//'; foreach ($routines as $routine) { $definition = 'DROP ' . $routine['ROUTINE_TYPE'] . ' ' . PMA_backquote($routine['SPECIFIC_NAME']) . $delimiter . "\n" . PMA_DBI_get_procedure_or_function_def($db, $routine['ROUTINE_TYPE'], $routine['SPECIFIC_NAME']) . "\n"; if ($routine['ROUTINE_TYPE'] == 'PROCEDURE') { $sqlDropProc = 'DROP PROCEDURE ' . PMA_backquote($routine['SPECIFIC_NAME']); } else { $sqlDropProc = 'DROP FUNCTION ' . PMA_backquote($routine['SPECIFIC_NAME']); } echo sprintf('<tr class="%s">
<td><b>%s</b></td>
<td>%s</td>
<td>%s</td>
<td>%s</td>
<td>%s</td>
</tr>', ($ct%2 == 0) ? 'even' : 'odd', $routine['ROUTINE_NAME'], ! empty($definition) ? PMA_linkOrButton('db_sql.php?' . $url_query . '&amp;sql_query=' . urlencode($definition) . '&amp;show_query=1&amp;delimiter=' . urlencode($delimiter), $titles['Structure']) : '&nbsp;', '<a href="sql.php?' . $url_query . '&sql_query=' . urlencode($sqlDropProc) . '" onclick="return confirmLink(this, \'' . PMA_jsFormat($sqlDropProc, false) . '\')">' . $titles['Drop'] . '</a>', $routine['ROUTINE_TYPE'], $routine['DTD_IDENTIFIER']); $ct++; } echo '</table>'; echo '</fieldset>' . "\n"; } } ?>
